package com.css.dzj.dzjap.modules.publick.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "AP_PUBLIC", schema = "DZJAP", catalog = "")
public class ApPublicEntity {
    private String publicId;
    private String content;
    private String publicState;
    private String title;
    private String revokeg;
    private String enclosure;
    private String publicType;
    private Date createTime;
    private String createUser;
    private String delFlag;
    private String relationId;
    private Date inputenTime;
    private String attachContent;
    private String publicUrl;
    private String fictionType;
    private String enterType;
    private String publishType;
    private String publishMsg;
    private Date  publishTime;
    private String organName;
    // 发布类别 0：公示通报 1：标准规范
    private String isPublic;

    @Id
    @Column(name = "PUBLIC_ID")
    public String getPublicId() {
        return publicId;
    }

    public void setPublicId(String publicId) {
        this.publicId = publicId;
    }

    @Basic
    @Column(name = "CONTENT")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "PUBLIC_STATE")
    public String getPublicState() {
        return publicState;
    }

    public void setPublicState(String publicState) {
        this.publicState = publicState;
    }

    @Basic
    @Column(name = "TITLE")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "REVOKEG")
    public String getRevokeg() {
        return revokeg;
    }

    public void setRevokeg(String revokeg) {
        this.revokeg = revokeg;
    }

    @Basic
    @Column(name = "ENCLOSURE")
    public String getEnclosure() {
        return enclosure;
    }

    public void setEnclosure(String enclosure) {
        this.enclosure = enclosure;
    }

    @Basic
    @Column(name = "PUBLIC_TYPE")
    public String getPublicType() {
        return publicType;
    }

    public void setPublicType(String publicType) {
        this.publicType = publicType;
    }

    @Basic
    @Column(name = "CREATE_TIME")
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd HH:mm",timezone="GMT+8")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "CREATE_USER")
    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    @Basic
    @Column(name = "DELFLAG")
    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @Basic
    @Column(name = "RELATION_ID")
    public String getRelationId() {
        return relationId;
    }

    public void setRelationId(String relationId) {
        this.relationId = relationId;
    }

    @Basic
    @Column(name = "INPUTEN_TIME")
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    public Date getInputenTime() {
        return inputenTime;
    }

    public void setInputenTime(Date inputenTime) {
        this.inputenTime = inputenTime;
    }

    @Basic
    @Column(name = "ATTACH_CONTENT")
    public String getAttachContent() {
        return attachContent;
    }

    public void setAttachContent(String attachContent) {
        this.attachContent = attachContent;
    }

    @Basic
    @Column(name = "PUBLIC_URL")
    public String getPublicUrl() {
        return publicUrl;
    }

    public void setPublicUrl(String publicUrl) {
        this.publicUrl = publicUrl;
    }

    @Basic
    @Column(name = "FICTION_TYPE")
    public String getFictionType() {
        return fictionType;
    }

    public void setFictionType(String fictionType) {
        this.fictionType = fictionType;
    }

    @Basic
    @Column(name = "ENTER_TYPE")
    public String getEnterType() {
        return enterType;
    }

    public void setEnterType(String enterType) {
        this.enterType = enterType;
    }

    @Basic
    @Column(name = "PUBLISH_TYPE")
    public String getPublishType() {
        return publishType;
    }

    public void setPublishType(String publishType) {
        this.publishType = publishType;
    }

    @Basic
    @Column(name = "PUBLISH_MSG")
    public String getPublishMsg() {
        return publishMsg;
    }

    public void setPublishMsg(String publishMsg) {
        this.publishMsg = publishMsg;
    }

    @Basic
    @Column(name = "PUBLISH_TIME")
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd",timezone="GMT+8")
    public Date getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(Date publishTime) {
        this.publishTime = publishTime;
    }

    @Basic
    @Column(name = "ORGAN_NAME")
    public String getOrganName() {
        return organName;
    }

    public void setOrganName(String organName) {
        this.organName = organName;
    }

    @Basic
    @Column(name = "IS_PUBLIC")
    public String getIsPublic() {
        return isPublic;
    }

    public void setIsPublic(String isPublic) {
        this.isPublic = isPublic;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {return true;}
        if (o == null || getClass() != o.getClass()) {return false;}
        ApPublicEntity that = (ApPublicEntity) o;
        return Objects.equals(publicId, that.publicId) &&
                Objects.equals(content, that.content) &&
                Objects.equals(publicState, that.publicState) &&
                Objects.equals(title, that.title) &&
                Objects.equals(revokeg, that.revokeg) &&
                Objects.equals(enclosure, that.enclosure) &&
                Objects.equals(publicType, that.publicType) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(createUser, that.createUser) &&
                Objects.equals(delFlag, that.delFlag) &&
                Objects.equals(relationId, that.relationId) &&
                Objects.equals(inputenTime, that.inputenTime) &&
                Objects.equals(attachContent, that.attachContent) &&
                Objects.equals(publicUrl, that.publicUrl) &&
                Objects.equals(fictionType, that.fictionType) &&
                Objects.equals(enterType, that.enterType) &&
                Objects.equals(publishType, that.publishType) &&
                Objects.equals(publishTime, that.publishTime) &&
                Objects.equals(organName, that.organName) &&
                Objects.equals(publishMsg, that.publishMsg) &&
                Objects.equals(isPublic, that.isPublic);
    }

    @Override
    public int hashCode() {
        return Objects.hash(publicId, content, publicState, title, revokeg, enclosure, publicType, createTime, createUser, delFlag, relationId, inputenTime, attachContent, publicUrl, fictionType, enterType, publishType, publishMsg, publishTime,organName, isPublic);
    }
}
